The field of code quality has a lot of related work, I will shortly discuss the SIG Maintainability Model \textbf{\cite{MM}}, \textit{from now on the Maintainability Model}, simply because this model has a strong relation with practice and it has been used quite well by them.

First you should ask yourself the following question:
\begin{center}\textbf{\textit{What makes a system maintainable?}}\end{center}

At SIG they say that whether a system is maintainable is dependent of the analysability, changeability, stability and testablitily. They determine values for this by taking the averages of certain code metrics.

The Maintainability Model has a fixed number of simple metrics which are used to determine the quality of the code for the software system, how maintainable is this software system. To calculate the maintainablity they use the following metrics:

\begin{enumerate}\itemsep2pt
  \item Volume (\textbf{Lines of code})
  \item Cyclometic Complexity per unit \textbf{\cite{CC}}
  \item Duplication
  \item Unit size
  \item Unit testing
\end{enumerate}

Many studies have been done on the influence of Architecture on the quality of the end product, especially the implementation of that product. A study done by F.J. Lange and M. R. V. Chaudron \textbf{\cite{UMLInPractice}} showed that in practice incomplete or bad architecture leads to bad implementation of the end product. They mainly focus on UML as a modeling language for architecture because it has become the defacto way of doing it in recent years. This is interesting because we are looking at the possibility of doing code metrics on architecture to determine the quality of the end product before you start writing the code.